<?php
 class Membre{
 	
	private $nom;
	private $pseudo;
	private $email;
	private $telephone;
	private $numChambre;
	private $idMembre;
	private $accessLevel;
	
	public function ecrireFichier($maVariable){
		$fileName='debug.php';
		if(file_exists($fileName))unlink($fileName);
		$monfichier=fopen($fileName, 'a');
		fputs($monfichier, $maVariable);
		fclose($monfichier);
	}
	
	function __construct($idMembre){
		$this->idMembre=$idMembre;
		$query="select * from membres where id_membre='$idMembre'";
		$result=runQuery($query);
		$row=mysql_fetch_assoc($result);
		$this->nom=$row['nom'];
		$this->pseudo=$row['pseudo'];
		$this->telephone=$row['telephone'];
		$this->numChambre=$row['num_chambre'];
		$this->email=$row['email'];
		$this->accessLevel=$row['authorisation'];
	}
	function __destruct(){
		
	}
	public function getNom(){return $this->nom;}
	public function getPseudo(){return $this->pseudo;}
	public function getEmail(){return $this->email;}
	public function getTelephone(){return $this->telephone;}
	public function getNumChambre(){return $this->numChambre;}
	public function getIdMembre(){return $this->idMembre;}
	public function getAccessLevel(){return $this->accessLevel;}
	public function updateMembre($me){
		$query="update membres set";

		
		$query .="where id_membre=$this->idMembre";
	}
	
// setters
 public function setNom(){
		
	}
	public function setPseudo(){
		
	}
	public function setEmail($email){
	$query="update membres set email='$email' where id_membre=$this->idMembre";
	$this->email=$email;
	}
	public function setTelephone(){
	$query="update membres set telephone='$telephone' where id_membre=$this->idMembre";
	$this->telephone=$telephone;
	}
	public function setNumChambre(){
		
	}
	public function setIdMembre(){
		
	}
	public function setPassword(){
		
	}
	
 }